<?php

namespace App\Services\Wechat;

use EasyWeChat\Factory;

class WorkService
{
    private function __construct()
    {
    }

    public static function getInstance($plat = 'ms')
    {
        $conf = config('wechat.work')[$plat ?? 'ms'];
        $config = [
            'corp_id' => $conf['corp_id'],
            'agent_id' => $conf['agent_id'],
            'secret' => $conf['secret'],
            'aes_key' => $conf['aes_key'],
            'response_type' => 'array',
            'log' => [
                'level' => 'debug',
                'file' => MY_LOG_PATH . '/work.log',
            ],
        ];
        $app = Factory::work($config);
        return $app;
    }

    private function __clone()
    {
    }
}
